class Alg<E extends Comparable<E>> {
    public E findMax(E[] arr) {
        E max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max.compareTo(arr[i]) < 0) {
                max = arr[i];
            }
        }
        return max;
    }
}
public class Test {
    public static void main(String[] args) {
        Integer[] arr = {1,5,7,12,2,23};
        Alg<Integer> a = new Alg<Integer>();
        int max = a.findMax(arr);
        System.out.println(max);
    }
}
